package Game;

public class Player {
    
    private int life;
    private int cards;
    private Deck deck;
    private Hand hand;
    
    public Player(Deck deck) {
        this.life = 1500;
        this.deck = deck;
        this.hand = new Hand();
    }

    public int getLife() {
        return life;
    }

    public void setLife(int life) {
        this.life = life;
    }
    
    public void beCured(int cure){
        life += cure;
    }
    
    public void takeDamage(int damage){
        life -= damage;
    }

    public int getCards() {
        return cards;
    }

    public void setCards(int cards) {
        this.cards = cards;
    }

    public Deck getDeck() {
        return deck;
    }

    public void setDeck(Deck deck) {
        this.deck = deck;
    }

    public Hand getHand() {
        return hand;
    }

    public void setHand(Hand hand) {
        this.hand = hand;
    }
    
    public void fillHand(){
        for(int i = 0; i < 3; i++){
            if(!hand.isOcupied(i)){
                hand.setCard(i, deck.pop());
                deck.swap(0, 14);
                cards--;
            }
        }
    }
}
